<?php

namespace App\Models\V6;

use Illuminate\Database\Eloquent\Model;

class AppUserMessageModel extends Model
{
    protected $table = 'use_device_info';
    protected $fillable = ['user_id', 'open_app_date', 'phone_system', 'app_version'];

    /**
     * 保存提交的数据
     * @param $userId 用户的ID
     * @param $openAppDate 打开APP的时间
     * @param $phoneSystem 用户的手机系统
     * @param $appVersion APP的版本信息
     * @return static
     */
    public function store($userId, $openAppDate, $phoneSystem, $appVersion)
    {
        $status = $this->create([
            'user_id'       => $userId,
            'open_app_date' => $openAppDate,
            'phone_system'  => $phoneSystem,
            'app_version'   => $appVersion
        ]);
        return $status;
    }
}